﻿Imports Q7P1TTS.Lib
Public Class FeedbackDetail
    Dim fb As New Complaint()
    Public Sub New(ByVal ID As Integer)
        InitializeComponent()
        fb = ComplaintController.load(ID)
    End Sub
    Private Sub FeedbackDetail_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblRefNo.Text = fb.RefNumber
        lblCategory.Text = fb.Category.Name
        lblSubmitOn.Text = ConvertHelper.ToDateTime(fb.SubmitOn, "MM/dd/yyyy")
        lblComplainantName.Text = fb.Customer.FirstName & " " & fb.Customer.LastName
        lblStatus.Text = fb.Status
        If fb.Investigations.Count > 0 Then
            pnInvestigation.Visible = True
            Dim invest As Investigation = fb.Investigations(0)
            If invest.IsValid Then
                lblValidity.Text = "Yes"
            Else : lblValidity.Text = "No"
            End If
            txtInvestigation.Text = invest.ValidReason
            lblDriver.Text = invest.Employee.FullName
        Else : pnInvestigation.Visible = False
        End If
        If fb.Actions.Count > 0 Then
            pnAction.Visible = True
            Dim act As Action = fb.Actions(0)
            lblActionDate.Text = ConvertHelper.ToDateTime(act.CreateDate, "MM/dd/yyyy")
            lblRepresentative.Text = EmployeeController.load(act.CreateBy).FullName
            txtActionDetail.Text = act.ActionDetail
        Else : pnAction.Visible = False
        End If
    End Sub
End Class
